<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-bind命令</title>
</head>
<body>
    
    <div id="smartParty" v-clock>
        <div>
            <img :src="'images/'+url+'.jpg'" alt="" >
        </div>
        <button @click="add">点我加1</button>
        <button @click="minus">点我减1</button>
    </div>
    <script src="js/vue2.js"></script>
    <script>
        var vue = new Vue({
            el: "#smartParty",
            data: {
                url: 0
            },
            methods: {
                add() {
                    this.url ++
                    if (this.url >= 5) {
                        this.url = 0;
                    }
                }, minus() {
                    if (this.url <= 0) {
                        this.url = 5;
                    }
                    this.url --
                }
            }
        })
    </script>
</body>
</html>